package com.sgam.mf.dao.stock;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.sgam.mf.domain.stock.StockSold;

@Repository
public class StockSoldDAOImpl implements StockSoldDAO {
	
	@Autowired
	SessionFactory sessionFactory;
	
	
	
//	public List<StockSold> list() {
//		List<StockSold>  result = sessionFactory.getCurrentSession().createQuery("from StockSold").list();
//		return result;
//	}
	
	
	
	public List<StockSold> getStockSoldByForUserByDate(Integer userId, Date forDate) {
		List<StockSold>  result  = sessionFactory.getCurrentSession().getNamedQuery("getStockSoldByForUserByDate").setInteger("USER_ID", userId).setDate("SOLD_DATA", forDate).list();
		
		return result;
	}




}

	
